package com.java.controller;

import com.java.enity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.PreDestroy;

@Controller
public class UserController {
    @Autowired
    private User user;

    public void PrintUser(){
        System.out.println(user);
        user.setAge(2);
        System.out.println(user);
    }

    @PreDestroy
    public void doPreDestroy(){
        System.out.println("do 注解方式销毁");
    }

}
